package com.atguigu.enu;
//枚举类中只有一个对象时，则可以作为单例模式的实现方式
//如何定义枚举类
/*
方式一:JDK5.0之前，自定义枚举类
方式二:JDK5.0时，可以使用enum关键字定义枚举类
 */
public class SeaonTest {
    public static void main(String[] args) {
        Season1 spring = Season1.SPRING;

    }
}
//自定义枚举类
class Season1 {
    //3.提供当前枚举类的多个对象:public static final的
    public static final Season1 SPRING=new Season1("春天","万物生长");
    public static final Season1 SUMMER=new Season1("夏天","火热炎炎");
    public static final Season1 AUTUMN=new Season1("秋天","火红枫叶");
    public static final Season1 WINTER=new Season1("冬天","万物寂寥");
    //1.声明Season类的对象的属性 :需要用private final来进行修饰
    private final String seasonName;
    private final String seasonDesc;
    //2.私有化类的构造器,并给对象属性赋值
    private Season1(String seasonName, String seasonDesc){
        this.seasonDesc=seasonDesc;
        this.seasonName=seasonName;
    }
    //4.其他诉求，获取枚举类对象的属性，提供对应的get方法
}
